import wepy from 'wepy'
/**
 * 封装全局通用的totast提示
 * tit通过=给一个默认值
 */
wepy.baseToast = function(tit = '获取数据失败') {
    wepy.showToast({
        title: tit,
        icon: 'none',
        duration: 2000
    })
}

const baseURL = 'https://www.zhengzhicheng.cn/api/public/v1'
wepy.get = function(url, data = {}) {
    return wepy.request({
        url: baseURL + url,
        method: 'GET',
        data
    })
}
wepy.post = function(url, data = {}) {
    return wepy.request({
        url: baseURL + url,
        method: 'POST',
        data
    })
}